package com.example.wxminiprogram.controller;

import com.example.wxminiprogram.pojo.Floor;
import com.example.wxminiprogram.pojo.Result;
import com.example.wxminiprogram.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class HomeController {
    @Autowired
    private HomeService homeService;
    @GetMapping("/api/public/v1/home/swiperdata")
    public Result getSwiperData(){
        return Result.success(this.homeService.getAllSwiper());
    }
    @GetMapping("/api/public/v1/home/catitems")
    public Result getNavData(){
        return Result.success("OK");
    }
    @GetMapping("/api/public/v1/home/floordata")
    public Result getFloorData(){
        return Result.success(this.homeService.getFloor());
    }
}
